package com.yanghs.common.entity.hbm;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Collection;

/**
 * @author yanghs
 * @Description:
 * @date 2018/3/14 21:28
 */
public class Userinfo implements Serializable {
    private static final long serialVersionUID = 1L;
    private String userid;
    private String username;
    private String password;
    private String email;
    private String phonenum;
    private Timestamp createdtime;
    private Timestamp updatetime;
    private String usable;
    private String locked;
    private String overdue;
    // 不序列化
    private transient Collection<UserRole> userRolesByUserid;

    public Userinfo() { }

    public Userinfo(String userid, String username, String email, String phonenum) {
        this.userid = userid;
        this.username = username;
        this.email = email;
        this.phonenum = phonenum;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhonenum() {
        return phonenum;
    }

    public void setPhonenum(String phonenum) {
        this.phonenum = phonenum;
    }

    public Timestamp getCreatedtime() {
        return createdtime;
    }

    public void setCreatedtime(Timestamp createdtime) {
        this.createdtime = createdtime;
    }

    public Timestamp getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Timestamp updatetime) {
        this.updatetime = updatetime;
    }

    public String getUsable() {
        return usable;
    }

    public void setUsable(String usable) {
        this.usable = usable;
    }

    public String getLocked() {
        return locked;
    }

    public void setLocked(String locked) {
        this.locked = locked;
    }

    public String getOverdue() {
        return overdue;
    }

    public void setOverdue(String overdue) {
        this.overdue = overdue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Userinfo userinfo = (Userinfo) o;

        if (userid != null ? !userid.equals(userinfo.userid) : userinfo.userid != null) return false;
        if (username != null ? !username.equals(userinfo.username) : userinfo.username != null) return false;
        if (password != null ? !password.equals(userinfo.password) : userinfo.password != null) return false;
        if (email != null ? !email.equals(userinfo.email) : userinfo.email != null) return false;
        if (phonenum != null ? !phonenum.equals(userinfo.phonenum) : userinfo.phonenum != null) return false;
        if (createdtime != null ? !createdtime.equals(userinfo.createdtime) : userinfo.createdtime != null)
            return false;
        if (updatetime != null ? !updatetime.equals(userinfo.updatetime) : userinfo.updatetime != null) return false;
        if (usable != null ? !usable.equals(userinfo.usable) : userinfo.usable != null) return false;
        if (locked != null ? !locked.equals(userinfo.locked) : userinfo.locked != null) return false;
        if (overdue != null ? !overdue.equals(userinfo.overdue) : userinfo.overdue != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userid != null ? userid.hashCode() : 0;
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (phonenum != null ? phonenum.hashCode() : 0);
        result = 31 * result + (createdtime != null ? createdtime.hashCode() : 0);
        result = 31 * result + (updatetime != null ? updatetime.hashCode() : 0);
        result = 31 * result + (usable != null ? usable.hashCode() : 0);
        result = 31 * result + (locked != null ? locked.hashCode() : 0);
        result = 31 * result + (overdue != null ? overdue.hashCode() : 0);
        return result;
    }

    public Collection<UserRole> getUserRolesByUserid() {
        return userRolesByUserid;
    }

    public void setUserRolesByUserid(Collection<UserRole> userRolesByUserid) {
        this.userRolesByUserid = userRolesByUserid;
    }
}
